#!/bin/sh

#delete the old installation
rm -rf CLcalc
rm CLcalc-*.tar.gz

#create a new dir
mkdir CLcalc
mkdir CLcalc/include
mkdir CLcalc/lib

#copy the library
find ../dist -name libCLcalc.dylib -exec cp '{}' CLcalc/lib \;

#copy the headers
cp ../include/* CLcalc/include/.

#build the Java API and the javadoc
cd ../JCLcalc
ant
cd ../Installation

#copy the Java API
cp ../JCLcalc/dist/JCLcalc.jar CLcalc/lib/.

#copy the javadoc
cp -r ../JCLcalc/dist/javadoc CLcalc/.

#tar it
tar -cf CLcalc-0.1-rXX-MacOSX-Intel-x64.tar CLcalc
gzip CLcalc-0.1-rXX-MacOSX-Intel-x64.tar